﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.SqlClient;
using System.Data.Sql;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


namespace Gare
{
    public partial class Form1 : Form
    {
        private SqlConnection connection;

        public Form1()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            obSQL("localhost", "gare");
        }


        public void obSQL(string instance, string dbdir) //windows authentication
    {
        connection = new SqlConnection();
        connection.ConnectionString = "Data Source=" + instance + ";" +
                                      "Trusted_Connection=yes;" +
                                      "database=" + dbdir + "; " +
                                      "connection timeout=3";
        connection.Open();
    }

        }
    }
